<template>
  <auth-button :size="btnSize" class="iconCircle" :icon="'iconfont iconshenhe'" :title="'审核'" v-if="btnDisplay" @click="showReview" :menuCode="menuCode" :perms="perms"></auth-button>
</template>

<script>
  import AuthButton from '@/components/auth/authButton'
  export default {
    components: {AuthButton},
    props: {
      // 所属菜单Code-->全局唯一
      menuCode: {
        type: String,
        default: null
      },
      // 按钮权限标识，外部使用者传入
      perms: {
        type: String,
        default: null
      },
      // 按钮类型
      btnType: {
        type: String,
        default: function () {
          return 'primary'
        }
      },
      // 按钮大小
      btnSize: {
        type: String,
        default: function () {
          return 'small'
        }
      },
      // 是否显示
      btnDisplay: {
        type: Boolean,
        default: function () {
          return true
        }
      },
      // 服务名
      serverName: {
        type: String,
        require: true
      },
      // 画面名: {
      frameName: {
        type: String,
        require: true
      },
      // 行数据
      rowData: {
        type: Object,
        default: function () {
          return null
        }
      },
      // 行号
      rowIndex: {
        type: Number,
        default: function () {
          return null
        }
      }
    },
    computed: {
      btnID () {
        return this.serverName + '-' + this.frameName + '-review'
      }
    },
    methods: {
      showReview () {
        let returnData = {}
        returnData.clickType = 'R'
        returnData.rowData = this.rowData
        returnData.rowIndex = this.rowIndex
        this.$emit('operateBtnClick', returnData)
      }
    }
  }
</script>
